import React from 'react'
import { Link } from 'react-router-dom';

export let Iteminfo = props => {
    return (
        <div className='item-head'>
            <div className='user-info'>
                <Link to={'/people/' + props.data.userid}>
                    <img className='avatar' src={'/img/' + props.data.icon}></img>
                </Link>
                <div className='user-desc'>
                    <Link to={'/people/' + props.data.userid} className=''>
                        <p className='username'>{props.data.name}</p>
                    </Link>
                    <p className='publish-item'>{props.data.classname}</p>
                </div>
            </div>
            <p className='dynamic'>{props.data.content}</p>
            <div className='img-list'>
                {props.data.imgs.split(',').map((item, i) => {
                    return <a href={`/img/${item}`} target="_blank" key={i}><img src={`/img/${item}`} className='home-img' ></img></a>
                })
                }
            </div>
        </div>
    );
}
